<?php
		class CgPatent extends AppModel
		{
			var $name = "CgPatent";
			var $primarykey = 'id';
			
			var $hasMany = array (
		    		'Attachment' => array (
					'className' => 'Attachment',
					'conditions' => array("Attachment.is_deleted='0'"),
					'foreignKey' => 'pid',
		    		),
		    		'pros_cvalue' => array (
					'className' => 'ProCvalue',
					'foreignKey' => 'pid',
		    		),
    		);
    		
    	   var $belongsTo = array(
				        'Photo' => array(
				        'className'    => 'Attachment',
				        'foreignKey'    => 'photo_id'
				        )
   			 );
		}
?>